package housing.task3.dto;

import housing.task3.dto.PK.HsRequestPk;

import java.io.Serializable;
import java.util.Date;

public class HsRequest implements Serializable {
    /**
     * This attribute maps to the column request_id in the HS_Request table.
     */
    protected int requestId;

    /**
     * This attribute maps to the column workType_id in the HS_Request table.
     */
    protected int worktypeId;

    /**
     * This attribute maps to the column workScale_id in the HS_Request table.
     */
    protected int workscaleId;

    /**
     * This attribute maps to the column renter_id in the HS_Request table.
     */
    protected int renterId;

    /**
     * This attribute maps to the column date in the HS_Request table.
     */
    protected Date date;

    /**
     * Method 'HsRequest'
     */
    public HsRequest() {
    }

    /**
     * Method 'getRequestId'
     *
     * @return int
     */
    public int getRequestId() {
        return requestId;
    }

    /**
     * Method 'setRequestId'
     *
     * @param requestId
     */
    public void setRequestId(int requestId) {
        this.requestId = requestId;
    }

    /**
     * Method 'getWorktypeId'
     *
     * @return int
     */
    public int getWorktypeId() {
        return worktypeId;
    }

    /**
     * Method 'setWorktypeId'
     *
     * @param worktypeId
     */
    public void setWorktypeId(int worktypeId) {
        this.worktypeId = worktypeId;
    }

    /**
     * Method 'getWorkscaleId'
     *
     * @return int
     */
    public int getWorkscaleId() {
        return workscaleId;
    }

    /**
     * Method 'setWorkscaleId'
     *
     * @param workscaleId
     */
    public void setWorkscaleId(int workscaleId) {
        this.workscaleId = workscaleId;
    }

    /**
     * Method 'getRenterId'
     *
     * @return int
     */
    public int getRenterId() {
        return renterId;
    }

    /**
     * Method 'setRenterId'
     *
     * @param renterId
     */
    public void setRenterId(int renterId) {
        this.renterId = renterId;
    }

    /**
     * Method 'getDate'
     *
     * @return Date
     */
    public Date getDate() {
        return date;
    }

    /**
     * Method 'setDate'
     *
     * @param date
     */
    public void setDate(Date date) {
        this.date = date;
    }

    /**
     * Method 'equals'
     *
     * @param _other
     * @return boolean
     */
    public boolean equals(Object _other) {
        if (_other == null) {
            return false;
        }

        if (_other == this) {
            return true;
        }

        if (!(_other instanceof HsRequest)) {
            return false;
        }

        final HsRequest _cast = (HsRequest) _other;
        if (requestId != _cast.requestId) {
            return false;
        }

        if (worktypeId != _cast.worktypeId) {
            return false;
        }

        if (workscaleId != _cast.workscaleId) {
            return false;
        }

        if (renterId != _cast.renterId) {
            return false;
        }

        if (date == null ? _cast.date != date : !date.equals(_cast.date)) {
            return false;
        }

        return true;
    }

    /**
     * Method 'hashCode'
     *
     * @return int
     */
    public int hashCode() {
        int _hashCode = 0;
        _hashCode = 29 * _hashCode + requestId;
        _hashCode = 29 * _hashCode + worktypeId;
        _hashCode = 29 * _hashCode + workscaleId;
        _hashCode = 29 * _hashCode + renterId;
        if (date != null) {
            _hashCode = 29 * _hashCode + date.hashCode();
        }

        return _hashCode;
    }

    /**
     * Method 'createPk'
     *
     * @return HsRequestPk
     */
    public HsRequestPk createPk() {
        return new HsRequestPk(requestId);
    }

    /**
     * Method 'toString'
     *
     * @return String
     */
    public String toString() {
        StringBuffer ret = new StringBuffer();
        ret.append("housing.task3.dto.HsRequest: ");
        ret.append("requestId=" + requestId);
        ret.append(", worktypeId=" + worktypeId);
        ret.append(", workscaleId=" + workscaleId);
        ret.append(", renterId=" + renterId);
        ret.append(", date=" + date);
        return ret.toString();
    }

}
